package book;

public class BookList {
    private Book[] books = new Book[10];
    private int usedSize;//记录当前books数组当中有多少本书

    public BookList() {
        books[0] = new Book("java","张三",89,"学习");
        books[1] = new Book("c++","李四",67,"学习");
        books[2] = new Book("python","王五",55,"学习");
        books[3] = new Book("c","赵六",99,"学习");
        this.usedSize = 4;
    }


    public Book getBook(int pos) {
        return this.books[pos];
    }
    public int getUsedSize() {
        return usedSize;
    }
    public void setBook(Book book) {
        this.books[usedSize] = book;
    }

    public void setBook(int pos,Book book) {
        this.books[pos] = book;
    }

    public void setUsedSize(int usedSize) {
        this.usedSize = usedSize;
    }
}
